﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using RealtReview.DataAccess.Interfaces;
using RealtReview.DataAccess.SearchParameters;
using RealtyReview.Business.Interfaces;
using RealtyReview.Business.Models.News;
using RealtyReview.Business.Models.ViewModels;

namespace RealtyReview.Business.Services
{
    public class NewsService : INewsService
    {
        INewsRepository newsRepository;
        private DbContext dbContext;

        public NewsService(INewsRepository newsRepository, DbContext realtReviewContext)
        {
            this.newsRepository = newsRepository;
            this.dbContext = realtReviewContext;
        }

        public IList<NewsListViewModel> GetNewsList(BaseSearchParameters parameters)
        {
            throw new NotImplementedException();
        }

        public NewsViewModel GetNewsDetails(Guid newsId)
        {
            throw new NotImplementedException();
        }

        public bool DeleteNews(Guid newsId)
        {
            var news = newsRepository.Get(newsId);
            if (news != null)
            {
                newsRepository.Delete(news);
                return true;
            }
            return false;
        }

        public bool ModifyNews(NewsViewModel model)
        {
            throw new NotImplementedException();
        }

        public Guid AddNews(NewsViewModel model)
        {
            throw new NotImplementedException();
        }
    }
}
